module hybrid_coord_ecmwf_mod

  use const_mod

  implicit none

  private

  public hybrid_coord_ecmwf_l50

contains

  subroutine hybrid_coord_ecmwf_l50(p0, ptop, hyai, hybi)

    real(r8), intent(out) :: p0
    real(r8), intent(out) :: ptop
    real(r8), intent(out) :: hyai(50)
    real(r8), intent(out) :: hybi(50)

    hyai = [20.006149    , & !  1
            43.297810    , & !  2
            75.346230    , & !  3
            115.082146   , & !  4
            161.897491   , & !  5
            215.896912   , & !  6
            278.005798   , & !  7
            350.138184   , & !  8
            435.562286   , & !  9
            539.651489   , & ! 10
            668.615540   , & ! 11
            828.398987   , & ! 12
            1026.366943  , & ! 13
            1271.644531  , & ! 14
            1575.537842  , & ! 15
            1952.054443  , & ! 16
            2418.549805  , & ! 17
            2996.526611  , & ! 18
            3712.626221  , & ! 19
            4599.856934  , & ! 20
            5699.114746  , & ! 21
            6998.388184  , & ! 22
            8507.411133  , & ! 23
            10181.707031 , & ! 24
            11883.089844 , & ! 25
            13442.915039 , & ! 26
            14736.354492 , & ! 27
            15689.206055 , & ! 28
            16266.609375 , & ! 29
            16465.003906 , & ! 30
            16297.620117 , & ! 31
            15791.597656 , & ! 32
            14985.269531 , & ! 33
            13925.519531 , & ! 34
            12665.294922 , & ! 35
            11261.230469 , & ! 36
            9771.406250  , & ! 37
            8253.210938  , & ! 38
            6761.339844  , & ! 39
            5345.917969  , & ! 40
            4050.718750  , & ! 41
            2911.570312  , & ! 42
            1954.804688  , & ! 43
            1195.890625  , & ! 44
            638.148438   , & ! 45
            271.625000   , & ! 46
            72.062500    , & ! 47
            0.000000     , & ! 48
            0.000000     , & ! 49
            0.000000]        ! 50

    hybi = [0.000000     , & !  1
            0.000000     , & !  2
            0.000000     , & !  3
            0.000000     , & !  4
            0.000000     , & !  5
            0.000000     , & !  6
            0.000000     , & !  7
            0.000000     , & !  8
            0.000000     , & !  9
            0.000000     , & ! 10
            0.000000     , & ! 11
            0.000000     , & ! 12
            0.000000     , & ! 13
            0.000000     , & ! 14
            0.000000     , & ! 15
            0.000000     , & ! 16
            0.000000     , & ! 17
            0.000000     , & ! 18
            0.000000     , & ! 19
            0.000000     , & ! 20
            0.000000     , & ! 21
            0.000000     , & ! 22
            0.000100     , & ! 23
            0.000673     , & ! 24
            0.003163     , & ! 25
            0.009292     , & ! 26
            0.020319     , & ! 27
            0.036975     , & ! 28
            0.059488     , & ! 29
            0.087895     , & ! 30
            0.122004     , & ! 31
            0.161442     , & ! 32
            0.205703     , & ! 33
            0.254189     , & ! 34
            0.306235     , & ! 35
            0.361145     , & ! 36
            0.418202     , & ! 37
            0.476688     , & ! 38
            0.535887     , & ! 39
            0.595084     , & ! 40
            0.653565     , & ! 41
            0.710594     , & ! 42
            0.765405     , & ! 43
            0.817167     , & ! 44
            0.864956     , & ! 45
            0.907716     , & ! 46
            0.944213     , & ! 47
            0.972985     , & ! 48
            0.992281     , & ! 49
            1.000000]        ! 50

    p0 = 1d5 ! Pa
    hyai = hyai / p0
    ptop = p0 * hyai(1)

  end subroutine hybrid_coord_ecmwf_l50

end module hybrid_coord_ecmwf_mod
